import {MockMethod} from 'vite-plugin-mock'
import {baseApi} from "../../config";

export default [
    {
        // 在线用户列表
        url: `${baseApi}/system/online/list`,
        //params:{ipaddr:null,userName:null,pageNum:1,pageSize:10},
        method: 'get',
        response: () => {
            return {
                "code": 0,
                "message": "",
                "data": {
                    "currentPage": 0,
                    "total": 5,
                    "list": [
                        {
                            "id": 5,
                            "uuid": "d07a1bcb8fcc243321c57da6bf6ec58a",
                            "token": "",
                            "createdAt": "2024-11-08 09:14:50",
                            "userName": "demo",
                            "ip": "::1",
                            "explorer": "Edge",
                            "os": "Windows 10"
                        },
                        {
                            "id": 4,
                            "uuid": "afb35f91b52edd837ee4916d7e3cb1c9",
                            "token": "",
                            "createdAt": "2024-11-07 17:09:13",
                            "userName": "demo",
                            "ip": "::1",
                            "explorer": "Edge",
                            "os": "Windows 10"
                        },
                        {
                            "id": 3,
                            "uuid": "bbb540b47821a7f586fe2b558b00c701",
                            "token": "",
                            "createdAt": "2024-11-07 16:38:23",
                            "userName": "demo",
                            "ip": "::1",
                            "explorer": "Edge",
                            "os": "Windows 10"
                        },
                        {
                            "id": 2,
                            "uuid": "8a11598e08f6232678ae2358b4d9bb1a",
                            "token": "",
                            "createdAt": "2024-09-10 17:40:41",
                            "userName": "demo",
                            "ip": "::1",
                            "explorer": "Edge",
                            "os": "Windows 10"
                        },
                        {
                            "id": 1,
                            "uuid": "78af8be7af943d0b8bfe11cfa21d936e",
                            "token": "",
                            "createdAt": "2024-09-10 16:53:16",
                            "userName": "demo",
                            "ip": "::1",
                            "explorer": "Edge",
                            "os": "Windows 10"
                        }
                    ]
                }
            }
        }
    },
    {
        // 强制退出
        url: `${baseApi}/system/online/forceLogout`,
        params: {"ids": [3]},
        method: 'delete',
        response: () => {
            return {
                "code": 68,
                "message": "token is invalid",
                "data": null
            }
        }
    },
] as MockMethod[]
